#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
int main()
{
    int *ptr=(int*)malloc(100);
    printf("ptr指向的内存大小:%ld\n",malloc_usable_size(ptr));
    printf("ptr:%p\n",ptr);
    //扩大内存
    ptr=realloc(ptr,400);
    printf("ptr指向的内存大小:%ld\n",malloc_usable_size(ptr));
    printf("ptr:%p\n",ptr);
    //缩小内存
    ptr=realloc(ptr,200);
    printf("ptr指向的内存大小:%ld\n",malloc_usable_size(ptr));
    printf("ptr:%p\n",ptr);
    return 0;
}